package com.cos.lession51.entity;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * @author: COS
 * @time: 2022/3/4 10:14
 * @description:
 */
@ToString
public class Emp {
    private int eno;
    private String ename;
    private String esex;

    public Emp() {
        System.out.println("emp这个类被实例化了");
    }

    public Emp(int eno, String ename, String esex) {
        this.eno = eno;
        this.ename = ename;
        this.esex = esex;
    }


    public void init(){
        System.out.println("emp初始化了");
    }
    public void destroy(){
        System.out.println("emp被干掉了");
    }

    @Override
    protected void finalize() throws Throwable {
        super.finalize();
        System.out.println("触发回收");
    }
}
